package zzs.generalframework.coder.common.model;

import zzs.generalframework.util.core.string.StringUtils;

/**
 * @title
 * @description
 * @project zzs-coder
 * @package zzs.generalframework.coder.common.model
 * @author zzs
 * @date 2018年1月31日
 * @version 1.0
 */
public class FieldInfo
{

	private String accessModifier;
	private String fieldType;
	private String fieldName;
	private AnnotationInfo annotationInfo;

	public String getAccessModifier()
	{
		return accessModifier;
	}

	public void setAccessModifier(String accessModifier)
	{
		this.accessModifier = accessModifier;
	}

	public String getFieldType()
	{
		return fieldType;
	}

	public void setFieldType(String fieldType)
	{
		this.fieldType = fieldType;
	}

	public String getFieldName()
	{
		return fieldName;
	}

	public void setFieldName(String fieldName)
	{
		this.fieldName = fieldName;
	}

	public AnnotationInfo getAnnotationInfo()
	{
		return annotationInfo;
	}

	public void setAnnotationInfo(AnnotationInfo annotationInfo)
	{
		this.annotationInfo = annotationInfo;
	}

	@Override
	public String toString()
	{
		StringBuffer fieldBuffer = new StringBuffer();
		if (annotationInfo != null)
		{
			fieldBuffer.append(annotationInfo.toString()).append("\n");
		}
		if (StringUtils.isNotNullAndBlank(accessModifier))
		{
			fieldBuffer.append(accessModifier);
		}
		else
		{
			fieldBuffer.append("private");
		}
		fieldBuffer.append(fieldType).append(" ").append(fieldName).append(";").append("\n");
		return fieldBuffer.toString();
	}

}
